//3-1 MUX
//Last modified by yangjao at 2021/5/10

module MUX_3_1(
    input wire[1:0] S,
    input wire[31:0] data_in1,
    input wire[31:0] data_in2,
    input wire[31:0] data_in3,

    output reg[31:0] data_out
);

always@(*)begin
    if(S==2'b00)begin
        data_out = data_in1;
    end else if(S==2'b01)begin
        data_out = data_in2;
    end else if(S==2'b11)begin
        data_out = data_in3;
    end else begin
        data_out = data_in1;
    end
end

endmodule